package com.ss.android.article.browser.download.a;

import android.content.DialogInterface;
import android.text.format.Formatter;
import android.util.Log;
import android.webkit.URLUtil;

import com.ss.android.common.app.permission.PermissionsResultAction;
import com.ss.android.common.dialog.AlertDialog;

final class c extends PermissionsResultAction {
    private final b e;
    public final String a;
    private final String b;
    private final String c;
    private final long f;
    private final String d;

    c(com.ss.android.article.browser.download.a.b arg2, String arg3, String arg4, String arg5, long arg6, String arg8) {
        this.e = arg2;
        this.a = arg3;
        this.b = arg4;
        this.c = arg5;
        this.f = arg6;
        this.d = arg8;
    }

    public final void onGranted() {
        String v1 = URLUtil.guessFileName(this.a, this.b, this.c);
        String v0 = this.f > 0 ? Formatter.formatFileSize(com.ss.android.article.browser.download.a.b.a(this.e), this.f) : com.ss.android.article.browser.download.a.b.a(this.e).getString(com.ss.android.article.browser.R.string.a1p);
        d v2 = new d(this);
        android.support.design.a.resizeDialog(com.ss.android.article.browser.download.a.b.a(this.e), new AlertDialog.Builder(com.ss.android.article.browser.download.a.b.a(this.e)).setTitle(((CharSequence) v1)).setMessage(com.ss.android.article.browser.download.a.b.a(this.e).getString(com.ss.android.article.browser.R.string.hz, new Object[]{v0})).setPositiveButton(com.ss.android.article.browser.download.a.b.a(this.e).getResources().getString(com.ss.android.article.browser.R.string.bp), ((DialogInterface.OnClickListener) v2)).setNegativeButton(com.ss.android.article.browser.download.a.b.a(this.e).getResources().getString(com.ss.android.article.browser.R.string.bg), v2).show());
        Log.i("LightningDownloader", "Downloading: " + v1);
    }

    public final void onDenied(String arg1) {
    }
}

